﻿using System;
using System.Linq;
using System.Text;
using DongFangGuoKai.WMSPlatform.Domain.Enums;
using SqlSugar;

namespace DongFangGuoKai.WMSPlatform.Domain.Models
{
    ///<summary>
    ///指令记录
    ///</summary>
    [SugarTable("DBO.t_Instruct")]
    public partial class t_Instruct
    {
        public t_Instruct()
        {


        }
        /// <summary>
        /// Desc:指令Id
        /// Default:
        /// Nullable:False
        /// </summary>           
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string? WarehouseCode { get; set; }

        /// <summary>
        /// Desc:垛入库存储Id
        /// Default:
        /// Nullable:True
        /// </summary>           
        public int? StackingStorageId { get; set; }

        /// <summary>
        /// Desc:指令状态：0-创建，1-待执行，2-执行中，3-搬运完成，4-处理完成，5-执行异常，6-已强制取消任务
        /// Default:
        /// Nullable:False
        /// </summary>           
        public int Status { get; set; }

        /// <summary>
        /// Desc:指令类型：1-上架、2-下架、3-移位、4-盘点指令
        /// Default:
        /// Nullable:False
        /// </summary>           
        public EmInstructType InstructType { get; set; }

        /// <summary>
        /// Desc:工作设备类型：1-线体;2-AGV
        /// Default:1
        /// Nullable:True
        /// </summary>           
        public EmWorkDeviceType? WorkDeviceType { get; set; }

        /// <summary>
        /// Desc:
        /// Default:0
        /// Nullable:True
        /// </summary>           
        public EmDeviceAction? Action { get; set; }

        /// <summary>
        /// Desc:指令优先级
        /// Default:1
        /// Nullable:False
        /// </summary>           
        public int Priority { get; set; }

        /// <summary>
        /// Desc:源位置：可以是货位或者站台编号
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string? FromLocation { get; set; }

        /// <summary>
        /// Desc:预计目的地址
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string? ExpectedToLocation { get; set; }

        /// <summary>
        /// Desc:实际目标位置
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string? ToLocation { get; set; }

        /// <summary>
        /// Desc:任务数量
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public decimal QTY { get; set; }

        /// <summary>
        /// Desc:
        /// Default:0
        /// Nullable:True
        /// </summary>           
        public decimal? FinishedQTY { get; set; }

        /// <summary>
        /// Desc:按项目需求，客户定制的垛条码
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string? PalletBarcode { get; set; }

        /// <summary>
        /// Desc:WCS上报的扫描到的条码，可能与垛号不一样，用于指令完成快速查询
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string? ScanedBarcode { get; set; }

        /// <summary>
        /// Desc:指令执行顺序
        /// Default:1
        /// Nullable:False
        /// </summary>           
        public int InstructIndex { get; set; }

        /// <summary>
        /// Desc:指令开始时间
        /// Default:DateTime.Now
        /// Nullable:True
        /// </summary>           
        public DateTime? StartTime { get; set; }

        /// <summary>
        /// Desc:指令完成时间
        /// Default:
        /// Nullable:True
        /// </summary>           
        public DateTime? EndTime { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        //public bool? IsSendSuccess {get;set;}

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public int? RelatedOrderId { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public int? RelatedOrderDetailId { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string? DeviceCode { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public int? FromRoutewayId { get; set; }

        /// <summary>
        /// Desc:业务类型
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public int BusinessType { get; set; }

        /// <summary>
        /// Desc:业务分组Id
        /// Default:newid()
        /// Nullable:False
        /// </summary>           
        public Guid BusinessGroupId { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public int? BillType { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string? RefCellCode { get; set; }

        /// <summary>
        /// Desc:
        /// Default:0
        /// Nullable:True
        /// </summary>           
        public bool? IsSuspend { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string? LogicalCellAddr { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public int? CreateUserId { get; set; }

        /// <summary>
        /// Desc:
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string? CreateUserName { get; set; }

        ///// <summary>
        ///// Desc:出入库code
        ///// Default:
        ///// Nullable:True
        ///// </summary>           
        public string? RelatedOrderDetailCode { get; set; }

        ///// <summary>
        ///// Desc:
        ///// Default:
        ///// Nullable:True
        ///// </summary>           
        public string? StackingStorageCode { get; set; }

    }
}
